
require 'TemplateSystem'
require 'json/pure'

class ServerView
  
  include TemplateSystem
  
  def initialize()  #TODO: Parameter model
      @innerHTML = ""
  end
  
  def getAllHTML(webpage)
    return getWholeHTML(webpage,'mhtml')
  end
   
  def buildResponse(toJson)
    if (toJson.is_a?(Hash))
      return JSON(toJson)
    else
      hs = Hash.new()
      hs.store("Result" , toJson)
      return JSON(hs)
    end
  end
  
end